﻿using System.Diagnostics;
using LFSRecord2.Model.Undo;

namespace LFSRecord2.Model.UserActions
{
    public class UserActionDeleteAudioLayer : UserActionBase
    {
        // Action description, so we can replay this action (and reverse it)
        public int LayerIndex { get; set; }

        public AudioLayerData Layer { get; set; }

        public UserActionDeleteAudioLayer()
        {
            Action = UserActionTypes.DeleteAudioLayer;
        }

        public override void DoUndo()
        {
            Debug.WriteLine("Undoing a DeleteAudioLayer action");
            LfsRecordController.project.ReinstateLayer(Layer);
        }

        public override void DoRedo()
        {
            Debug.WriteLine("Redoing a DeleteAudioLayer action");
            LfsRecordController.project.DeleteLayer(LfsRecordController.project.AudioLayers[LayerIndex]);
        }
    }
}
